package com.ljx.dao;

import com.ljx.config.DatasourceTypeEnum;
import com.ljx.config.SwitchDatasource;
import com.ljx.model.entity.Student;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * Company: 上海数惠系统技术有限公司
 * Department: 数据中心：研发二部
 * Date: 2021/04/11 11:52
 *
 * @Author: Ljxpa
 * Email: lujx@dist.com.cn
 * Desc:
 */
public interface StudentRepo extends JpaRepository<Student, Integer> {

	@SwitchDatasource(dataSource = DatasourceTypeEnum.WRITE)
	List<Student> findAllByIdGreaterThan(Integer id);

	@SwitchDatasource(dataSource = DatasourceTypeEnum.READ)
	List<Student> findAllByIdLessThan(Integer id);
}
